Skip to content

feat: Add basic JS/Jest basic support#86

Merged
cbasitodx merged 15 commits into
mainfrom
sebas_conde/feat/js_jest_basic_capabilities_clean
Jun 22, 2026
Merged

feat: Add basic JS/Jest basic support#86
cbasitodx merged 15 commits into
mainfrom
sebas_conde/feat/js_jest_basic_capabilities_clean

Conversation

@cbasitodx

@cbasitodx cbasitodx commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?
Adds initial JavaScript/Jest support to ddtest.

This includes:

  • New javascript platform detection and sanity checks for Node.js and dd-trace/ci/init
  • Automatic NODE_OPTIONS=-r dd-trace/ci/init injection for dd-trace-js instrumentation
  • Runtime/OS tag collection from Node.js
  • New jest framework integration with default Jest test include/exclude patterns
  • Jest execution through local node_modules/.bin/jest, custom command override, or npx jest
  • Planner support for frameworks that do not support full test discovery: TIA skippables are not fetched/applied, while generic fast test-file discovery and duration-based splitting still run
  • Unit coverage for the new platform, Jest framework, runner mocks, and planner behavior

Motivation
ddtest currently supports Ruby workloads, but Test Optimization also needs JavaScript coverage. This PR starts that support by adding Jest integration, enabling ddtest to plan and run JavaScript test files while automatically initializing dd-trace-js.

How to test the change?
Run the focused package tests:

go test ./internal/platform ./internal/framework ./internal/planner ./internal/runner

Run the full test suite:

go test ./...

@cbasitodx cbasitodx added enhancement New feature or request go Pull requests that update go code labels Jun 16, 2026

@anmarchenko anmarchenko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a first pass, it has the right direction and there are 2 main improvement areas:

  • I am not convinced that we really need exclude pattern for frameworks - it makes the implementation more complex than needed
  • somehow there are a lot of duplicated code in the framework.go that repeats what we already have and call in discovery.go package

Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/framework/jest.go Outdated
Comment thread internal/planner/planner.go Outdated
Comment thread internal/planner/planner.go
@datadog-official

datadog-official Bot commented Jun 18, 2026

Copy link
Copy Markdown

Tests  Code Coverage

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 96.12%
Overall Coverage: 87.65% (+0.47%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 6db0424 | Docs | Datadog PR Page | Give us feedback!

…iscovery and remove Jest's built-in exclude list, so generated directories remain discoverable unless users exclude them explicitly.
Comment thread internal/discovery/discovery.go Outdated
Comment thread internal/framework/framework.go Outdated
Comment thread internal/planner/planner.go Outdated
@cbasitodx cbasitodx changed the title feat: Add basic JS/Jest basic support (WIP) feat: Add basic JS/Jest basic support Jun 22, 2026
@cbasitodx cbasitodx marked this pull request as ready for review June 22, 2026 12:40
@cbasitodx cbasitodx requested a review from a team as a code owner June 22, 2026 12:40
@DataDog DataDog deleted a comment from datadog-official Bot Jun 22, 2026
@cbasitodx cbasitodx merged commit 82a2817 into main Jun 22, 2026
4 checks passed
@cbasitodx cbasitodx deleted the sebas_conde/feat/js_jest_basic_capabilities_clean branch June 22, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants